﻿using HamcoWcs.Entitys.Bases;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;

namespace HamcoWcs.Entitys.BcrReadInfos
{
    public class BcrReadInfo : BaseEntity, IEntityTypeConfiguration<BcrReadInfo>
    {
        public BcrReadInfo()
        {
            
        }

    

        public BcrReadInfo(string bcrName, int rQty, int fQty, DateTime setTime)
        {
            BcrName = bcrName;
            RQty = rQty;
            FQty = fQty;
            SetTime = setTime;
        }

        public string BcrName { get; set; }
        public int RQty { get; set; }
        public int FQty { get; set; }
        public DateTime SetTime { get; set; }
        public void Configure(EntityTypeBuilder<BcrReadInfo> builder)
        {
            builder.HasComment("读码率信息");
            builder.Property(x => x.BcrName).IsRequired().HasMaxLength(30).HasComment("Bcr名称");
            builder.Property(x => x.RQty).HasDefaultValue(0).HasComment("读取次数");
            builder.Property(x => x.FQty).HasDefaultValue(0).HasComment("异常次数");
        }
    }
}
